'use strict';

module.exports = app => {
  const { INTEGER, DATE } = app.Sequelize;

  const JobStatistics = app.model.define('job_statistics', {
    statisticsId: {
      type: INTEGER,
      primaryKey: true,
      autoIncrement: true,
      field: 'statistics_id',
      comment: '统计编号'
    },
    jobId: {
      type: INTEGER,
      allowNull: false,
      field: 'job_id',
      comment: '岗位编号'
    },
    applicationCount: {
      type: INTEGER,
      allowNull: false,
      defaultValue: 0,
      field: 'application_count',
      comment: '投递人数'
    },
    viewCount: {
      type: INTEGER,
      allowNull: false,
      defaultValue: 0,
      field: 'view_count',
      comment: '查看人数'
    },
    interviewCount: {
      type: INTEGER,
      allowNull: false,
      defaultValue: 0,
      field: 'interview_count',
      comment: '面试人数'
    },
    hireCount: {
      type: INTEGER,
      allowNull: false,
      defaultValue: 0,
      field: 'hire_count',
      comment: '录用人数'
    },
    statisticsTime: {
      type: DATE,
      allowNull: false,
      field: 'statistics_time',
      defaultValue: app.Sequelize.NOW,
      comment: '统计时间'
    }
  }, {
    tableName: 'job_statistics',
    timestamps: false,
    comment: '岗位投递数据表'
  });

  return JobStatistics;
};











































